package com.epam.task.oop.medicines;

import com.epam.task.oop.Characters.MedicineCategory;

import java.io.Serializable;

public class Nutrition extends PharmacyProducts implements Serializable {
    private static final long serialVersionUID = 1L;
    private double nutritionalValue;

    public Nutrition(String name, String manufacturer, String dateSalesStart,
                     int count, float price, double nutritionalValue, int id) {
        super(name, manufacturer, dateSalesStart, count, price, id);
        this.nutritionalValue = nutritionalValue;
    }

    public double getNutritionalValue() {
        return nutritionalValue;
    }

    public void setNutritionalValue(double nutritionalValue) {
        this.nutritionalValue = nutritionalValue;
    }

    @Override
    public String toString() {
        String res = "Name: " + this.getName() + ", id: " + this.getId()
                + ", Manufacture: " + this.getManufacturer() + " , Date sales start: " + this.getDateSalesStart()
                + " , " + this.getCount() + " pcs, price: " + this.getPrice()
                + " , Nutritional value is: " + this.getNutritionalValue();
        return res;
    }


    @Override
    public float countCost() {
        return (float) (this.getCount() * this.getPrice()*(getNutritionalValue()/100));
    }
}
